import { IFeidaoAiNodejsComponent } from '@feidao-factory/atom-nodejs/interfaces';
import get_i18n from '../i18n/get';

import render from '@feidao-factory/atom-nodejs/render/render';

////////////////////////////////////////////////////////////////////////////////
// import presentations
import nodejs from '@feidao-factory/atom-nodejs/msg/nodejs';
import p001 from './p001';
import p002 from './p002';
////////////////////////////////////////////////////////////////////////////////

export default async function nba001(fd: IFeidaoAiNodejsComponent, ...args: any[]) {
	const lang = fd.data.params.lang as string;
	const { actionid, sessionid, spaceid } = fd.data.headers;
	const result = await nodejs<string>(actionid, sessionid, spaceid, `page/zj-000001/s001`, { lang, param: 'abc' });
	window.console.info('nnnnnnnnnnnn', result);
	const l000003 = get_i18n(lang, 'l000003');
	const data = { l000003, total: 100 };
	render(fd.data.node, data, p001, 'p001');
	render(fd.data.node, data, p002, 'p002');
}
